package org.spring.springboot.domain;

import org.json.JSONObject;

public class GraphFile {
    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getSname() {
        return sname;
    }

    public void setSname(String sname) {
        this.sname = sname;
    }

    public String getParent() {
        return parent;
    }

    public void setParent(String parent) {
        this.parent = parent;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public String getIconURL() {
        return iconURL;
    }

    public void setIconURL(String iconURL) {
        this.iconURL = iconURL;
    }

    public String getMaintype() {
        return maintype;
    }

    public void setMaintype(String maintype) {
        this.maintype = maintype;
    }

    public String getFiletype() {
        return filetype;
    }

    public void setFiletype(String filetype) {
        this.filetype = filetype;
    }

    public String getProjectid() {
        return projectid;
    }

    public void setProjectid(String projectid) {
        this.projectid = projectid;
    }

    public String getFolder() {
        return folder;
    }

    public void setFolder(String folder) {
        this.folder = folder;
    }

    private String uuid;
    private String sname;
    private String parent;
    private String data;
    private String iconURL;
    private String maintype;
    private String filetype;
    private String projectid;
    private String folder;

    public String getExtInfo() {
        return extInfo;
    }

    public void setExtInfo(String extInfo) {
        this.extInfo = extInfo;
    }

    private String extInfo;

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    private  String userid;

    public GraphFile(){
        this.uuid = "";
        this.sname = "";
        this.parent = "";
        this.data = "";
        this.iconURL = "";
        this.maintype = "";
        this.filetype = "";
        this.projectid = "";
        this.folder = "root";
    }
    public GraphFile(String uuid, String sname, String parent, String data, String iconURL, String maintype, String filetype, String projectid, String folder) {
        this.uuid = uuid;
        this.sname = sname;
        this.parent = parent;
        this.data = data;
        this.iconURL = iconURL;
        this.maintype = maintype;
        this.filetype = filetype;
        this.projectid = projectid;
        this.folder = folder;
    }

    public JSONObject toJson(){
        JSONObject obj = new JSONObject();
        obj.put("uuid",this.uuid);
        obj.put("name",this.sname);
        obj.put("parent",this.parent);
        obj.put("iconURL",this.iconURL);

        obj.put("data",this.data);
        obj.put("maintype",this.maintype);
        obj.put("filetype",this.filetype);
        obj.put("projectid",this.projectid);
        obj.put("folder",this.folder);
        obj.put("userid",this.userid);
        obj.put("extInfo",this.extInfo);
        return obj;
    }
}
